<?php
/**
 * Created by PhpStorm.
 * User: john james
 * Date: 2018/12/25
 * Time: 16:07
 */

namespace App\Http\Controllers;

use App\Http\Model\UserModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Http\Model\MongodbModel;
class UserController extends Controller{
    public static function index(Request $request,Db $db,UserModel $user,MongodbModel $mongo){
        $r  = $request->all();
        if($request->method()=="GET"){
            dump($r);
            dump($r["nickname"]);
        }
        $u = $user->findAll();
        dump($u);
        $u =  $user->getOne(2);
        dump($u);
        echo "hello Laravel!";
        $mongo->insert(["aa"=>"bb"]);
        dump($mongo->get()->toArray());

    }
}